<script>
	import Vue from 'vue'
	import toast from '@/common/toast/index.js'
	export default {
		data() {
			return {
				intervalID: null
			}
		},
		onLaunch: function() {
			uni.getSystemInfo({
				success: function(e) {
					let StatusBar = e.statusBarHeight;
					let CustomBar = e.statusBarHeight;
					let contentHeight = e.windowHeight;
					// #ifndef MP
					StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						CustomBar = e.statusBarHeight + 50;
					} else {
						CustomBar = e.statusBarHeight + 45;
					};
					// #endif

					// #ifdef MP-WEIXIN
					StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif		

					// #ifdef MP-ALIPAY
					StatusBar = e.statusBarHeight;
					CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif

					Vue.prototype.contentHeight = contentHeight - CustomBar;
					Vue.prototype.StatusBar = StatusBar;
					Vue.prototype.CustomBar = CustomBar;
					// console.log('窗口高度：', e.screenHeight, '内容高度：', Vue.prototype.contentHeight, '底部TAB高度：', e.screenHeight - e.windowHeight,
					// 	'状态栏高度：', CustomBar)
				}
			})

			this.$store.dispatch('bluetooth/BLEInit').then(() => {
				this.$store.dispatch('bluetooth/getState')
				this.$store.dispatch('bluetooth/connBLE').then(() => {
					this.$store.dispatch('bluetooth/listenBLE')
				})
				console.log(this.$store.state.bluetooth)
			})

			this.$store.dispatch('bluetooth/getBLEState')
			this.isRaedHelp()
		},
		onShow: function() {

		},
		onHide: function() {

		},
		methods: {
			isRaedHelp() {
				let isRaedHelp = uni.getStorageSync('isRaedHelp')
				if (isRaedHelp !== true) {
					setTimeout(() => {
						uni.navigateTo({
							url: '/pages/help/help'
						})
					}, 1500)
				}
			}
		}
	}
</script>

<style>
	@import "/colorui/main.css";
	@import "/colorui/icon.css";
	@import "/colorui/animation.css";

	.uni-slider-handle-wrapper {
		height: 9px !important;
	}


	@font-face {
		font-family: "iconfont";
		src: url('//at.alicdn.com/t/font_2137530_21i7s7iizqf.eot?t=1602937925251');
		/* IE9 */
		src: url('//at.alicdn.com/t/font_2137530_21i7s7iizqf.eot?t=1602937925251#iefix') format('embedded-opentype'),
			/* IE6-IE8 */
			url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAATsAAsAAAAACXQAAASeAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDHAqGLIU3ATYCJAMQCwoABCAFhG0HSxssCFFUTopkPzV5UqRNMhtGoJvxzi1wCigsAABIAAAAgHj4//2+7XPv/appZpJo0qrQJyEiiZLEMpnSYXVCo3uGxnpX07bMfanC7+BqmnxFa+qb/bS95JJ+Wei2W5RgUAKEA+EYykNtJinkQcnIkjiMP//AMtH/n2Om6/T8NptLRutob4CjaB3Ydp3eeMB3wnjD2OVFPk6gbcm2tXPHl3PoKfTjAvFMRR70Eg6lghma5nrBpUV8UNNML9NXAO+9v48/4ESPpJbpp549OAph93v/+26mKxquOQjK4XxgV5GxDRTiUWHgDhEUtgltubblAGgavsRQG+Pvu1WFVVsxNPG/PEKSiTrd0EXYvWLme98SE3wfi0l833XIEF2ObqJF1IjbALvw+iLJZ85odNBbz+L5u6ofjzsOeiakyKqmZizXh1Lf1CenVMfIK1f3S3dj/XrUVC9NVU/2Hmp2H/dPSxKVjQ1AthZqVvZKKtbSMgoVPRIdQKYG5v1YiYiKZKIae29CSaoOGQ9j6ep2pk2qChkNYXmyAnhsIamIWmgwACQqWuhWyUpoOAhSECIxpiAkAIjeACqt0HMbq7ehK2vIr6qjplZyF+oMFhoQHiIGK4PP8K+ur+uS2AEuK4CFJjr54COq/R0xK4MSq/tZ2Zm+hz0SbJW9BSRVzWxJmjiThW3ZNSFDSxIRFSy1k9pUCfGR9OviiQg2VqIiVUbo4P/p6f8aiT8N0W9Gitn99nncVMWHZ6KLg6ODi3HWbwk3NZ59dr/i5bcN0Z80ampSNT4x3v13537KMrZ+lFRs/9/BU0be1Ee3Lz97HHIYbikmZmkPg9u5cqTE7scY/OJONE7k/hWzsxfLkeKapz0oGRAv1e4VqSFxe3+3XGYU28ULrNGsURcvRrnMCxdZpZnqqMzvEXNlZcv544f3OpaDMzo9O+wL6G+Yhe6R7m7xann2ATb3srPvWVebXTnZ1vcC7NXy8qT5r3KHswP14F/2lLyvc9MrRi1MNfjKlWDVMLWpcDVXGkrjUbWwGC/cW/X5u7lwtYi5slMtZM7ybfNs1rhNr0Lvh7VqGRXhuIVOASNOod7NQZDtFeI0Ekhm44REZKorqnoVtHwQe/uIrJ9ad1MBVDXiv0gAqJbEF3GES3vpn7D6vw6zc3njYzVw+Nvkf75j375q5714VdPSTfmTKBsr/yZlw4GiqHVnKZLGUqjB4mNMMYSubbj5hyqM/SHTrHEroWkWQdKwCFnTMrJgt6GmYw/qmg6hbcvJ1R0TmhClhU1PAMLQJyR9nyEb+kYW7C/UzP1D3TAEtF0I8Vt2rIYauGvymEL071AFZSFNNw/89ilFV5mn42qPtyTdqDTahpUun1BBeogzmuvIYZYodZnjMXgaZVmJlS4TCtiImauJacqiNzKCMoeBUxrxMBJCvjtICZQK0hnNBpnfnyKRKxmPrugrSy4RraG2RzaD1QB5Yiga9V3K7sa1iIMxiY+StFIOHUMfyYxCCVXFByVIgBniDrnKhImGyaYGY3pTfofnoE2/fYkUOUrUNF7EdB8ruxcqr7i7smyjXM/rrWIh73sFAAAA') format('woff2'),
			url('//at.alicdn.com/t/font_2137530_21i7s7iizqf.woff?t=1602937925251') format('woff'),
			url('//at.alicdn.com/t/font_2137530_21i7s7iizqf.ttf?t=1602937925251') format('truetype'),
			/* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
			url('//at.alicdn.com/t/font_2137530_21i7s7iizqf.svg?t=1602937925251#iconfont') format('svg');
		/* iOS 4.1- */
	}

	.iconfont {
		font-family: "iconfont" !important;
		font-size: 20px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	.icon-shezhi1:before {
		content: "\e609";
	}

	.icon-dianyuan:before {
		content: "\e60d";
	}

	.icon-lanya_huaban:before {
		content: "\e640";
	}
</style>
